package com.mxpio.webapp.entity;

import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * TCP信息历史记录表
 *
 * @author: Cheng
 * @date: 2022/10/28
 */
@Entity
@Table(name = "MI_MONITOR_TCP_HISTORY")
@ToString
@Data
@Schema(description = "TCP信息历史记录表")
public class MonitorTcpHistory extends BaseEntity {

    @Id
    @Generator
    @Schema(description = "id")
    @Column(name = "id", length = 64)
    private String id;

    @Schema(description = "TCP主表ID")
    @Column(name = "TCP_ID")
    private String tcpId;


    @Schema(description = "主机名（来源）")
    @Column(name = "HOSTNAME_SOURCE")
    private String hostnameSource;

    @Schema(description = "主机名（目的地）")
    @Column(name = "HOSTNAME_TARGET")
    private String hostnameTarget;

    @Schema(description = "端口号")
    @Column(name = "PORT_TARGET")
    private Integer portTarget;

    @Schema(description = "描述")
    @Column(name = "DESCR")
    private String descr;

    @Schema(description = "状态（0：不通，1：正常）")
    @Column(name = "STATUS")
    @Dict(dicCode = "MI_MONITOR_STATUS")
    private String status;

    @Schema(description = "平均响应时间（毫秒）")
    @Column(name = "AVG_TIME")
    private Long avgTime;

    @Schema(description = "离线次数")
    @Column(name = "OFFLINE_COUNT")
    private Integer offlineCount;

    @Schema(description = "新增时间")
    @Column(name = "INSERT_TIME")
    private Date insertTime;

    @Schema(description = "更新时间")
    @Column(name = "UPDATE_TIME")
    private Date updateTime;

    @Schema(description = "监控环境")
    @Column(name = "MONITOR_ENV")
    private String monitorEnv;

    @Schema(description = "监控分组")
    @Column(name = "MONITOR_GROUP")
    @Dict(dicCode = "MI_MONITOR_GROUP")
    private String monitorGroup;
}
